home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Html / insert Bold.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  839 b   |  33 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert Bold~wraps the current selection with 
  6. <B> ... </B> tags. 
  7. @EndTool: 
  8. @Summary: insert Bold~wraps selection with the Bold tag
  9. */
  10.  
  11. function DoCommand()  
  12. {
  13.     var editor = getActiveEditor();
  14.     if (editor)
  15.     {
  16.         var selection = editor.getSelection();
  17.         var upperCaseHtmlTags = getMapFileValue("Preferences", "Upper Case HTML Tags", true);
  18.         if(upperCaseHtmlTags)
  19.         {
  20.             editor.insert(selection.endLineIndex, selection.endCharIndex, "</B>");
  21.             editor.insert(selection.startLineIndex, selection.startCharIndex, "<B>");
  22.         }
  23.         else
  24.         {
  25.             editor.insert(selection.endLineIndex, selection.endCharIndex, "</b>");
  26.             editor.insert(selection.startLineIndex, selection.startCharIndex, "<b>");
  27.         }
  28.         editor.setActive();
  29.     }
  30. }
  31.  
  32. !!/Script
  33.